-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pallet Pass #22
Merged
Merged
Pallet Pass #22
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Pass] `register` and `claim`
- Limit devices per account - Handle unreservation of uninitialized accounts - Handle challenges using Randomness
fix: typo in RandomnessFromBlockNumber (added missing `n`)
…ntrib into pallet-pass-claim
…g on each registrar
Pallet pass `claim`
[Pass] Implement `dispatch` call
Revert "[Pass] Implement `dispatch` call"
…re generalistic usage / adjust interface of creation of a composite authenticator to explicitly state the `Authority`.
…cators` / cover macro use cases.
olanod
reviewed
Oct 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GH still shows some clippy warnings, can we address those?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3
Pallet Pass
Allows dispatching calls on behalf of a keyless account using an authenticator that resolves alternative signing methods.
Overview
Historically, having an account on the Web3 Ecosystem and using it to send transactions over a network has been as easy as having a private key which can sign those. Now, this ease comes with some tradeoffs. One of the most important is securely storing that key, to support signature operations.
Nonetheless, transactions are endorsed by accounts, not keys. A key is merely one means to get an
Account
. This pallet provides mechanisms for anAccount
to exist without necesarily hold a private key as traditionally known. This is done by introducing the concept of anAuthenticator
, very well known in the Web2 Ecosystem.Terminology
Authenticator
is a handler that allows processingChallenge
s to either gather access to theAccount
, or to register a newDevice
against theAccount
.Challenge
is the process where anAuthenticator
gathers a cryptographically verifiable input from aDevice
, and decides whether to provide access to anAccount
.Gas
is an unique handler that enables anAccount
to dispatch calls without it paying fees.Recovery
is a handler that allows registering a newDevice
when anUser
loses access to all theirDevice
s.Registrar
is a handler to create a newAccount
. The rules for registering a newAccount
are defined by anOrigin
.Session
is the result of being granted to use anAccount
via using aDevice
on anAuthenticator
. Can be either:Account
meanwhile theduration
is not exceeded. Theduration
will be at mostMaxDuration
.User
is an entity that ownsDevice
s to gather access to anAccount
.User
s can recover anAccount
whenever aRecovery
is enabled.Additionally, there are some concepts bound to implementation mechanisms, like:
Account
is anAccountId
derived from a registering process (typically, an username), that can be used to dispatch calls on its behalf.Goals
This pallet supports four main purposes:
Account
, and providing access to it via anAuthenticator
.Authenticator
(we call this short-liveSession
), or signed extrinsics previously registered on behalf of the pallet to control theAccount
for a limited time (we'll call this extended-sessions, and these signing keysDevice
s).Gas
handler.Account
via aRecovery
.Interface
Dispatchable Functions
register
/claim
: Given the data requested by theRegistrar
, generates a unique hash for derivating anAccount
.account_name
: An unique name for identifying theAccount
. Generally, an username.authenticator
: AnAuthenticator
registered on the pallet.device_id
: An unique identification for the firstDevice
attached to theAccount
against which to validate the authentication information.maybe_session
: An optional(ChallengePayload, SessionKey)
authenticate
: Opens a long-livedSession
using aDevice
and anAuthenticator
. Once it's opened, registers aSession
against theAccount
.account_name
: An unique name of theAccount
. Generally, an username.authenticator
: AnAuthenticator
registered on the pallet.device_id
: An descriptor for theDevice
attached to theAccount
against which to validate the authentication information, that decodes to the type of device accepted by theAuthenticator
.challenge_payload
: An encodedBoundedVec<u8, T::MaxPayloadSize>
with the information required by the authenticator to validate the device.session_key
: AnAccountId
to identify theSession
.add_device
: Requires being signed by anAccountId
registered as a validSession
for theAccount
. Receives the information of a new device.authenticator
: AnAuthenticator
registered on the pallet.device
: An descriptor for theDevice
attached to theAccount
against which to validate the authentication information, that decodes to the type of device accepted by theAuthenticator
.dispatch
: Dispatches a call on behalf of anAccount
if the signer is a validSession
or the authentication details are valid. The fees, if any, will be paid by theAccount
, or by the signer in case there's not anAccount
tied to a signed origin.call
: A validRuntimeCall
that can be dispatched on the runtime.maybe_authentication
: An optional(AccountName, Authenticator, DeviceId, )
tuple, sent to authenticate a device on-the-fly, producing a short-lived session.maybe_next_session_key
: An optionalAccountId
for the nextSession
key (AccountId
) that should be registered on behalf of theAccount
.Notes
The present version doesn't include a
GasHandler
. It'll be included in a further section that includes appropriate integrations withSignedExtensions
.